package com.zhitong.money.mapper;

import com.zhitong.money.entity.ScheduleTime;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author: Andy Zhang
 * @Description:
 * @Date: 16:14 2021/3/17
 * @Company: wisecard
 */
@Mapper
public interface ScheduleTimeMapper {

    @Results(id = "scheduleTimeMap",value = {
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "code",property = "code"),
            @Result(column = "cron",property = "cron"),
    })
    @Select("select * from scheduleTime where code = #{code}")
    public ScheduleTime getByCode(String code);

    @Update("update scheduleTime set cron = #{cron} where code = #{code}")
    public void updateByCode(ScheduleTime scheduleTime);

    @Select("select * from scheduleTime")
    public List<ScheduleTime> getAll();
}
